<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport"
          content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>

    <meta charset="UTF-8">
    <title>movies</title>
    <style>
        a{
            display: block;
            padding: 10px;
            text-decoration: none;
            color: #0033FF;
        }
        #movies_parent{
            list-style-type: none;
            padding:0;
        }
    </style>

    <script src="js/request.js"></script>
</head>
<body>
<ul id="movies_parent">
</ul>

<script>
    function isMobile() {
           let info = navigator.userAgent;
            let agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPod", "iPad"];
            for (let i = 0; i < agents.length; i++) {
                if (info.indexOf(agents[i]) >= 0) {
                    isMobile = true;
                    return true;
                }
            }
            isMobile = false;
            return false; 
    }

    const listView = document.getElementById("movies_parent");

    var data = [];
    if(isMobile()){
        data = [{
            "title": "巧奔妙逃",
            "url": "http://m.rr.tv/detail/34136?snum=1" 
        }, {
            "title": "战狼",
            "url": "http://m.rr.tv/detail/34936?snum=1"
        }, {
            "title": "战狼2",
            "url": "https://www.xuexi.cn/lgpage/detail/index.html?id=17378046918748607648&item_id=17378046918748607648"
        }, {
            "title": "大明劫",
            "url": "http://m.rr.tv/detail/35018?snum=1"
        }, {
            "title": "集结号",
            "url": "https://www.xuexi.cn/lgpage/detail/index.html?id=1700507597427630257"
        }, {
            "title":"叶问",
            "url":"https://m.rr.tv/detail/34990"
        }, {
            "title":"人在囧途",
            "url":"https://m.rr.tv/detail/34987?snum=1&episode=1"
        }, {
            "title":"你呀闭嘴",
            "url":"https://m.bilibili.com/bangumi/play/ep247792?theme=movie&from_spmid=666.7.feed.30"
        }, {
            "title":"灰猎犬号",
            "url":"https://www.bilibili.com/video/BV1ez4y1D7Lh?spm_id_from=333.337.search-card.all.click"
        }, {
            "title":"马达加斯加的圣诞",
            "url":"https://www.bilibili.com/bangumi/play/ss33008?theme=movie&from_spmid=666.25.series.0"
        }, {
            "title":"淘金记",
            "url":"https://www.bilibili.com/bangumi/play/ep279644?theme=movie&from_spmid=666.7.feed.294"
        }, {
            "title":"万万没想到",
            "url":"https://www.bilibili.com/bangumi/play/ep116211?theme=movie&from_spmid=666.7.feed.21"
        }];
    } else {
        data = [{
            "title": "巧奔妙逃",
            "url": "http://m.rr.tv/detail/34136?snum=1"
        }, {
            "title": "战狼",
            "url": "http://m.rr.tv/detail/34936?snum=1"
        }, {
            "title": "战狼2",
            "url": "https://www.xuexi.cn/lgpage/detail/index.html?id=17378046918748607648&item_id=17378046918748607648"
        }, {
            "title": "大明劫",
            "url": "http://m.rr.tv/detail/35018?snum=1"
        }, {
            "title": "集结号",
            "url": "https://www.xuexi.cn/lgpage/detail/index.html?id=1700507597427630257" 
        }, {
            "title": "绝地逃亡",
            "url": "https://www.ixigua.com/6569377600869761540?logTag=625e86bc2d6d0b8e262e"
        }, {
            "title": "机器侠",
            "url": "https://www.ixigua.com/6532729721308840452?logTag=8e031f30ac1033bd1df2"
        }, {
            "title": "疯狂外星人",
            "url": "https://www.ixigua.com/6785738251018699277?logTag=23c2fc7299b64dd44cdd"
        }, {
            "title": "囧妈",
            "url": "https://www.ixigua.com/6785109234167054862?logTag=f78c056bf427819ac3a6"
        }, {
            "title": "万万没想到",
            "url": "https://www.bilibili.com/bangumi/play/ep116211?theme=movie&from_spmid=666.7.feed.21"
        }, {
            "title": "摩登时代",
            "url": "https://www.bilibili.com/bangumi/play/ep258206?theme=movie&from_spmid=666.7.feed.90"
        }, {
            "title": "红海行动",
            "url": "https://www.1905.com/vod/play/1362986.shtml"
        }, {
            "title": "中国合伙人",
            "url": "https://www.1905.com/vod/play/670143.shtml"
        }, {
            "title": "菊次郎的夏天",
            "url": "https://www.1905.com/vod/play/1391254.shtml"
        }, {
            "title": "胖子行动队",
            "url": "https://www.1905.com/vod/play/1394194.shtml" 
        }, {
            "title": "万万没想到",
            "url": "https://www.bilibili.com/bangumi/play/ep116211?theme=movie&from_spmid=666.7.feed.23"
        }, {
            "title": "人在囧途",
            "url": "https://m.rr.tv/detail/34987?snum=1&episode=1"
        }, {
            "title":"叶问",
            "url":"https://m.rr.tv/detail/34990"
        }, {
            "title":"决战刹马镇",
            "url":"https://www.ixigua.com/6532729723443741192?logTag=cbb9214495cb631feca0"
        }, {
            "title":"A计划",
            "url":"https://www.ixigua.com/6569373922570011150?logTag=c3978d9aa663b7af9305"
        }, {
            "title":"你呀闭嘴",
            "url":"https://m.bilibili.com/bangumi/play/ep247792?theme=movie&from_spmid=666.7.feed.30"
        }, {
            "title":"灰猎犬号",
            "url":"https://www.bilibili.com/video/BV1ez4y1D7Lh?spm_id_from=333.337.search-card.all.click"
        }, {
            "title":"马达加斯加的圣诞",
            "url":"https://www.bilibili.com/bangumi/play/ss33008?theme=movie&from_spmid=666.25.series.0"
        }, {
            "title":"淘金记",
            "url":"https://www.bilibili.com/bangumi/play/ep279644?theme=movie&from_spmid=666.7.feed.294"
        }]
            }
            

    function parseResult(){
        let innerString = "";
        for(let i =0; i<data.length; ++i){
            innerString+= "<li><a href=\""+data[i].url+"\" target=\"_blank\">"+(i + 1)+"."+data[i].title+"</a></li>"
        }

        listView.innerHTML = innerString;
    }

    parseResult();
</script>


<!-- 
<script type="text/javascript" src="./js/getrequest.js"></script>
<script type="text/javascript">
    getRequest("https://divaid.github.io/htmlminifuncs/jsondata/movies", "", function(res){
        // console.log(JSON.parse(res).data)
        data = JSON.parse(res).data
        parseResult()
    })
</script> -->
</body>
</html>
